import request from '@u/request'
const UserModule = 'resource'

export function getBasemap(serviceName = '') {
  return request.get(`${UserModule}/mapbase/query`, {
    params: { serviceName },
  })
}
export function addMap(params) {
  return request.post(`${UserModule}/mapbase/add`, JSON.stringify(params))
}
export function editMap(id, params) {
  return request.put(
    `${UserModule}/mapbase/update/${id}`,
    JSON.stringify(params)
  )
}
export function delMap(serviceId) {
  return request.delete(`${UserModule}/mapbase/delete`, {
    params: {
      pkid: serviceId,
    },
  })
}
export const uploadUrl = `${window.BASE_URL}/${UserModule}/mapbase/upload`
